# Title     : TODO
# Objective : TODO
# Created by: Administrator
# Created on: 2020/10/19 0019

data(kostic2012crc)

kostic2012crc <- phyloseq::rarefy_even_depth(kostic2012crc,rngseed=1024)
table(sample_data(kostic2012crc)$DIAGNOSIS)

set.seed(1024)
diffres <- diff_analysis(obj=kostic2012crc, classgroup="DIAGNOSIS",
                         mlfun="lda",
                         filtermod="fdr",
                         firstcomfun = "kruskal.test",
                         firstalpha=0.05,
                         strictmod=TRUE,
                         secondcomfun = "wilcox.test",
                         subclmin=3,
                         subclwilc=TRUE,
                         secondalpha=0.01,
                         lda=3)

diffcladeplot <- ggdiffclade(obj=diffres,
                             alpha=0.3, size=0.2,
                             skpointsize=0.6,
                             taxlevel=3,
                             settheme=FALSE,
                             setColors=FALSE) +
  scale_fill_manual(values=c("#00AED7", "#FD9347"))+
  guides(color = guide_legend(keywidth = 0.1,
                              keyheight = 0.6,
                              order = 3,
                              ncol=1)) +
  theme(panel.background=element_rect(fill=NA),
        legend.position="right",
        plot.margin=margin(0,0,0,0),
        legend.spacing.y = unit(0.02, "cm"),
        legend.title=element_text(size=7),
        legend.text=element_text(size=6),
        legend.box.spacing=unit(0.02,"cm"))
diffcladeplot
